SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 45756: Excel raises exception when publishing to a PDF file in SAS® Financial Management

DetailsAboutRate It

Excel - Office 2007 raises an Exception when publishing to PDF


When running the SAS Financial Management Add-in for Microsoft Excel with Microsoft Office 2007, publishing or saving as a PDF might fail. To replicate the error follow these steps:

  • Create a report in the Excel client. Ensure that the report contains at least one slicer and at least two members within that slicer.
  • Select "Publish" and then "Report" from the FM Excel toolbar.
  • Select "Create a new Report", enter a Name and "Static" for type. Click "Next".
  • Select "PDF" for the file type. "Entire workbook" should be selected as the scope. Click "Next".
  • Select at least one slicer in the next window. Click "Next".
  • Select two members associated with the slicer. Click "Next".
  • Select "Create a single report". Click "next".
  • Select "Local folder" as the delivery method. Provide a valid folder name. Click "next".
  • Select "Do not save report settings". Click "Next".
  • Click "Finish" on the summary window.

You might get the following exception:
[mm/dd/yyyy hh:mm:ss] --------------- EXCEPTION REPORT ---------------
[mm/dd/yyyy hh:mm:ss] System.ArgumentException: Value does not fall within the
expected range.
at
Microsoft.Office.Interop.Excel.WorkbookClass.ExportAsFixedFormat(XlFixedFormatType
Type, Object Filename, Object Quality, Object IncludeDocProperties, Object
IgnorePrintAreas, Object From, Object To, Object OpenAfterPublish, Object
FixedFormatExtClassPtr)
at SASSESExcelAddIn.Publish.saveAsPDF(PublishDistribution
publishDistribution, String& fileName, Workbook wb) in
C:\Users\chconr\Documents\Visual Studio 2010\FM5.3_Testing\Controller\Excel\Publish.cs:line 1528
at SASSESExcelAddIn.Publish.publishReportDetails() in
C:\Users\chconr\Documents\Visual Studio 2010\FM5.3_Testing\Controller\Excel\Publish.cs:line 1020
[mm/dd/yyyy hh:mm:ss] System.Runtime.InteropServices.COMException (0x800A03EC):
Exception from HRESULT: 0x800A03EC
at Microsoft.Office.Interop.Excel._Worksheet.Select(Object Replace)
at SASSESExcelAddIn.Publish.publishReport() in
C:\Users\chconr\Documents\Visual Studio 2010\FM5.3_Testing\Controller\Excel\Publish.cs:line 1770
[mm/dd/yyyy hh:mm:ss] ----------- END OF EXCEPTION REPORT ------------

This failure occurs because Office2007 does not provide the functionality of saving a workbook as a PDF by default. To publish a PDF, a PDF Add-in can be easily downloaded from the MS Web site:


http://www.microsoft.com/download/en/details.aspx?id=9943



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Financial ManagementMicrosoft® Windows® for x645.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 2003 Datacenter Edition5.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 2003 Enterprise Edition5.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 2003 Standard Edition5.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 2003 for x645.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 20085.35.39.3 TS1M09.3 TS1M0
Microsoft Windows Server 2008 for x645.35.39.3 TS1M09.3 TS1M0
Microsoft Windows XP Professional5.35.39.3 TS1M09.3 TS1M0
Windows 7 Enterprise 32 bit5.35.39.3 TS1M09.3 TS1M0
Windows 7 Enterprise x645.35.39.3 TS1M09.3 TS1M0
Windows 7 Home Premium 32 bit5.35.39.3 TS1M09.3 TS1M0
Windows 7 Home Premium x645.35.39.3 TS1M09.3 TS1M0
Windows 7 Professional 32 bit5.35.39.3 TS1M09.3 TS1M0
Windows 7 Professional x645.35.39.3 TS1M09.3 TS1M0
Windows 7 Ultimate 32 bit5.35.39.3 TS1M09.3 TS1M0
Windows 7 Ultimate x645.35.39.3 TS1M09.3 TS1M0
Windows Vista5.35.39.3 TS1M09.3 TS1M0
Windows Vista for x645.35.39.3 TS1M09.3 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.